#define _CRT_SECURE_NO_WARNINGS
#include "variable.h"
extern float Max1, Min1;
extern int A, B, C;
float average(float array[], int n)
{
	int i;
	float aver, sum = array[0];
	Max1 = Min1 = array[0];
	for (i = 1; i < n; i++)
	{
		if (array[i] > Max1)
		{
			Max1 = array[i];
		}
		else if (array[i] < Min1)
		{
			Min1 = array[i];
		}
		sum = sum + array[i];
	}
	aver = sum / n;
	return aver;
}


int f(int a)
{
	auto int b = 0;
	static int c = 3;
	b += 1;
	c += 1;
	return a + b + c;
}


int fac(int n)
{
	static int f = 1;
	f *= n;
	return f;
}


int max1()
{
	int m;
	m = A > B ? A : B;
	if (C > m)
	{
		m = C;
	}
	return m;
}


int power(int n)
{
	int i, y = 1;
	for (i = 1; i <= n; i++)
	{
		y *= A;
	}
	return y;
}


void enter_string(char str[])
{
	gets_s(str, 80);
}


void delete_string(char str[], char ch)
{
	int j = 0;
	for (int v = 0; str[v] != '\0'; v++)
	{
		if (str[v] != ch)
		{
			str[j++] = str[v];
		}
	}
	str[j] = '\0';
}


void print_string(char str[])
{
	printf("%s\n", str);
}